/*
 * A4CANDataFields.cpp
 *
 *  Created on: Jul 19, 2011
 *      Author: matthew
 */

#include "A4CANDataFields.h"

void CA4CANDataFields::AddRawData(string strID, float fTime, vector<int> data){
	this->AddData(strID, fTime, data);
}

string CA4CANDataFields::GetRawDataDecString(unsigned int nIDIndex, unsigned int nElementIndex){
	string strRawDataDec;
	vector<int> RawData;

	if (nIDIndex >= this->GetNumIDs())
		return string("Error");
	else if (nElementIndex >= this->GetNumDataEntriesForIndex(nIDIndex))
		return string("Error");

	RawData = this->GetData(nIDIndex, nElementIndex);

	for (unsigned int nCounter = 0; nCounter < RawData.size(); nCounter++)
	{
		char strDecBytes[256];
		snprintf(strDecBytes, 256, "\t%d", RawData.at(nCounter));
		strRawDataDec.append(strDecBytes);
	}

	return strRawDataDec;
}
